package com.zbl.zblproject.erp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zbl.zblproject.erp.entity.ErpWarehouse;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author youlanqiang
 * @version 1.0
 * @date 2018/10/10
 */
@Repository
public interface ErpWarehouseMapper extends BaseMapper<ErpWarehouse> {


    /**
     * 分页功能
     * @param page
     * @param search 查询条件
     * @return
     */
    IPage<ErpWarehouse> selectPage(Page page, @Param("search") String search);

    IPage<ErpWarehouse> selectPageGroup(Page page, @Param("search") String search);


    List<ErpWarehouse> selectListByWarehouse(@Param("whName") String whName);

    /**
     * 查询所有的仓库名称
     * @param status
     * @return
     */
    List<String> selectHouseName(int status);

    /**
     * 根据仓库名称和状态查询架位
     * @param name
     * @param status
     * @return
     */
    List<String> selectShelves(@Param("name") String name,@Param("status") int status);


    /**
     *
     * @param search
     * @return
     */
    List<ErpWarehouse> selectListOfSearch(@Param("search") String search);


    ErpWarehouse selectDefaultWarehouseByGoodsId(int goodsId);

    @Select("SELECT * FROM  zbl_erp_warehouse LIMIT 1")
    ErpWarehouse selectDefaultOne();
}
